
print_string: {
	lda xy                ; load next char
	jpz print_string_done ; exit if null
	prn                   ; print char
	iny, jnc { inx, }     ; increment xy with carry
jpr }                     ; loop until null
print_string_done: rts    ; return

print_hex_digit:
	sub #$0A
	jnc { add #$07, }
	add #$3A
	prn
rts

print_hex:
	phf, phx, ldx a
	swn, and #$0F
	jsr print_hex_digit
	lda x
	and #$0F
	jsr print_hex_digit
	lda #'\n', prn
	lda x, ppx, ppf
rts
